Segments API: segments
The Segments API retrieves the list of segments associated with a customer. This can include marketing segments or any other customer groupings used in campaigns.
API Endpoint and Method
URL Format
https://{B2B_API_URL}/api/v1/profile/b2b/segments
Example URL
https://api-dev.algonomy.com/rcdpapi/api/v1/profile/b2b/segments
HTTP Method
POST
Request Header Parameters
Parameter |
Type | Required or Optional |
Description |
---|---|---|---|
access_token |
String |
Required |
Specifies the access token obtained from the create access token API. |
tenant_hash |
String |
Required |
Specifies the tenant hash shared with the tenant. |
gcrId | String | Required | Specifies the Golden Customer Record ID (GCR ID). |
mobile_number | String | Required |
Specifies customer's mobile number. Example: "1212121212" |
email_address | String | Required |
Specifies customer's email address. Example: "customer@example.com" |
customer_code_external |
String |
Required |
Specifies the external customer code. Example: "123456" |
- Notes:
-
You can send all the parameters (gcrId, mobile_number, and email_address) with the request or just one, as at least one parameter is required.
-
These parameters are supported based on the configuration. If your deployment is configured to use them as columns for deduplication, they will be available for use in the API call.
Request Body (Only For Pagination)
The Segments API facilitates paginated responses, where the initial request to the API does not require additional pagination parameters. However, for subsequent pages, you can furnish the page size along with a reference to the last-record pointer, denoted as 'lastKey' in the request payload. This 'lastKey' should indicate the record obtained from the preceding API response.
{
"lastKey":{
"HK_CUSTOMER_CODE":"1_1092",
"RK_DATE_KEY":5
},
“pageSize”:100
}
Response Body
A successful request returns a "200-OK" status code, accompanied by the retrieved data in the response.
{
"status": "OK",
"message": "",
"data": {
"customerId": 9876,
"totalCount": 5,
"lastKey": {
"HK_CUSTOMER_CODE": "1_1092",
"RK_DATE_KEY": 0
},
"dataList": [
{
"segmentId": 12345,
"segmentName": "lifestyle",
"segmentDesc": "lifestyle segment",
"createdDate": "24-Feb-2022 08:22:39 PM",
"count": 5,
"isPushToPersonalization": false,
"isSharedSegment": false
},
{
"segmentId": 12344,
"segmentName": "prodView",
"segmentDesc": "ProdView segment",
"createdDate": "16-Feb-2022 01:03:08 PM",
"count": 1,
"isPushToPersonalization": false,
"isSharedSegment": false
},
{
"segmentId": 12343,
"segmentName": "RFM",
"segmentDesc": "RFM segment",
"createdDate": "10-Jan-2022 02:14:14 PM",
"count": 2,
"isPushToPersonalization": false,
"isSharedSegment": false
},
{
"segmentId": 12342,
"segmentName": "Apparel",
"segmentDesc": "Apparel segment",
"createdDate": "07-Jan-2022 02:14:14 PM",
"count": 3,
"isPushToPersonalization": false,
"isSharedSegment": false
},
{
"segmentId": 12341,
"segmentName": "Male Above 50",
"segmentDesc": "Male Above 50 segment",
"createdDate": "01-Jan-2022 03:26:48 PM",
"count": 1,
"isPushToPersonalization": false,
"isSharedSegment": false
}
]
}
}